#include <string>

class keyboardInfo {
public:
	static bool isKeyboardNeighbor( char sourse, char target );
};

bool keyboardInfo::isKeyboardNeighbor( char sourse, char target )
{
	std::string neighbors;
	switch( sourse ) {
			case 'a':
				{
					neighbors = "qwsz";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'b':
				{
					neighbors = "vghn";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'c':
				{
					neighbors = "xdfv";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'd':
				{
					neighbors = "serfcx";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'e':
				{
					neighbors = "wsdfr";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'f':
				{
					neighbors = "drgvc";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'g':
				{
					neighbors = "fthbv";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'h':
				{
					neighbors = "gyjnb";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'i':
				{
					neighbors = "ujklo";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'j':
				{
					neighbors = "hukmn";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'k':
				{
					neighbors = "jilm";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'l':
				{
					neighbors = "pok";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'm':
				{
					neighbors = "njk";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'n':
				{
					neighbors = "bhjm";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'o':
				{
					neighbors = "iklp";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'p':
				{
					neighbors = "ol";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'q':
				{
					neighbors = "aws";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'r':
				{
					neighbors = "edft";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 's':
				{
					neighbors = "awdxz";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 't':
				{
					neighbors = "rfgy";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'u':
				{
					neighbors = "yhji";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'v':
				{
					neighbors = "cfgb";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'w':
				{
					neighbors = "qase";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'x':
				{
					neighbors = "zsdc";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'y':
				{
					neighbors = "tghu";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			case 'z':
				{
					neighbors = "asx";
					return neighbors.find(target) != std::string::npos ? true : false;
				}
			default:
				return false;
	}
	return false;
}